package com.woniu.cloud.movie.api.dto;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @ClassName 类名： Result
 * @Description 描述：
 * @Author haotian
 * @Date 时间：2022/1/12 11:58 上午
 * @Param 参数：
 * @Retrun 返回：
 **/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Result {
    private Integer code;
    private String message;
    private Object object;

    public static Result getInstance(Object o){
        Result result = new Result();
        result.setCode(200);
        result.setMessage("正常");
        result.setObject(o);
        return result;
    }

    public Result setCode(Integer code){
        this.code=code;
        return this;
    }

    public Result setMessage(String message){
        this.message = message;
        return this;
    }

    public Result setObject(Object o){
        this.object = o;
        return this;
    }
}
